package base.decorator;

import com.itheima.service.UserService;
import com.itheima.service.impl.UserServiceImpl;

/**
 * @program: Spring_day01_01_IOC入门程序
 * @description: 装修者模式（可以做增强）
 * 装饰者模式：在不惊动原始设计的基础上，为其添加功能。
 * @author: xuejingjing
 * @create: 2021-08-04 10:38
 **/
public class APP {
    public static void main(String[] args) {
        UserService userService = new UserServiceImpl();
        //用装饰者类创建对象
        UserService userService1 = new UserServiceImplDecorator(userService);
        UserService userService2 = new UserServiceImplDecorator2(userService1);//接着进行装饰
        userService2.save();

//        userService.save();
    }
}
